package com.ruoyi.pingan.fymodule.thirdpa.model;

import org.springframework.http.HttpStatus;

/**
 * 枚举了一些常用API操作码
 * Created on 2019/4/19.
 */
public enum ResultCode implements IErrorCode {
    SUCCESS(HttpStatus.OK.value(), "操作成功"),
    FAILED(HttpStatus.INTERNAL_SERVER_ERROR.value(), "操作失败"),
    VALIDATE_FAILED(4004, "参数检验失败"),
    UNAUTHORIZED(4001, "暂未登录或token已经过期"),
    FORBIDDEN(4003, "没有相关权限"),
    BAD_REQUEST(4000,"参数有误");
    private Integer code;
    private String message;

    private ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }
}
